#include <bits/stdc++.h>
// 2025/01/27
// tag:
// Author: Zhang Muen
using namespace std;

int n, s = -1, s2 = -1, e = -1, cnt, enter[1000], out[1000];
vector<int> graph[1001];
string words[1001];
vector<int> ans;
bool vis[1001];

void dfs(int x)
{
    if (cnt == n) {
        for (int i = 0; i < ans.size() - 1; i++)
            cout << words[ans[i]] << ".";
        cout << words[ans[ans.size() - 1]] << endl;
        exit(0);
    }
    for (auto i : graph[x]) {
        if (!vis[i]) {
            vis[i] = true;
            ans.push_back(i);
            cnt++;
            dfs(i);
            ans.pop_back();
            vis[i] = false;
            cnt--;
        }
    }
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> words[i], enter[words[i][0] - 'a']++, out[words[i][words[i].size() - 1] - 'a']++;
    sort(words + 1, words + n + 1);
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
            if (i != j && words[i][words[i].size() - 1] == words[j][0])
                graph[i].push_back(j);
    for (int i = 1; i <= n; i++)
        if (enter[words[i][0] - 'a'] == out[words[i][0] - 'a'] + 1) {
            vis[i] = true;
            ans.push_back(i);
            cnt++;
            dfs(i);
            ans.pop_back();
            vis[i] = false;
            cnt--;
        }
    vis[1] = true;
    ans.push_back(1);
    cnt++;
    dfs(1);
    cout << "***" << endl;
    return 0;
}